UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BlM3jidHoIxBLcnDP5NlfjqAgtGCx8bqHZMrxy+7N4g='
WHERE
key_id = '7bba134167fd25faf2352c2462d60fc5e1a1c5dc12b0881e195b22e8221cdc43'
AND (
token = 'BlM3jidHoIxBLcnDP5NlfjqAgtGCx8bqHZMrxy+7N4g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)