UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/5K/esoc9GhKAhh1mGFFRF7IH4mD2AXQTEouPpWYmQU='
WHERE
key_id = 'df7b502fdde0fad0567eaafa25bbf4617dca796775339483a2e5836e187aa16b'
AND (
token = '/5K/esoc9GhKAhh1mGFFRF7IH4mD2AXQTEouPpWYmQU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)