UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VBMSRFV3rEhCYfKt2G/h1uy+GefBpmw8oZcsL3VdV9g='
WHERE
key_id = '119671ea785dfddc3a880a9ddda0354203c0a59c2cf25603d3209992e7d5f0ce'
AND (
token = 'VBMSRFV3rEhCYfKt2G/h1uy+GefBpmw8oZcsL3VdV9g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)