UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8Lq1Dwc4nQmI8NeUT5Bh4k3Ten5BOEcDcsg6zdngkug='
WHERE
key_id = '8b24b5cb84653357ff036b8a3c0cb7d0f0433b0d94efe2aa287e8e0ecf472c97'
AND (
token = '8Lq1Dwc4nQmI8NeUT5Bh4k3Ten5BOEcDcsg6zdngkug='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)