UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'orYWBsH41cmg16dlXQSX3i4TWvhOoZ4T/HmNgsKwA6c='
WHERE
key_id = 'dd54293ec72639f09edaf780bda2981234d61bd272e322b628b9f88932fef626'
AND (
token = 'orYWBsH41cmg16dlXQSX3i4TWvhOoZ4T/HmNgsKwA6c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)