UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qjml9BoEDszQY1SJdYxcnhytpyzp1raJsTWixq8WZ4E='
WHERE
key_id = '888a1d0bb738fba92bc07071c9b1f8270ccf7b9b2610521f13a9f8bb9ba54845'
AND (
token = 'qjml9BoEDszQY1SJdYxcnhytpyzp1raJsTWixq8WZ4E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)