UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o2+gvDpFGrSRtTEobSsBpXFh8KahSBh4eIsObCRkrz0='
WHERE
key_id = '180d80822821baa9987dd42344702aae491357c45407bd5a759e6d3378e723e9'
AND (
token = 'o2+gvDpFGrSRtTEobSsBpXFh8KahSBh4eIsObCRkrz0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)