UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fpB5oUi1yP6fLmLEGjmfVgqENAMRvHMoqgst1DNz0yc='
WHERE
key_id = '36e2ac60d0d6847666b77453207c7ef894643061b3b66134b0a1c29d715bd46d'
AND (
token = 'fpB5oUi1yP6fLmLEGjmfVgqENAMRvHMoqgst1DNz0yc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)