UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k7dbJFZp1yBgQ3UmV/rCHGxtNOn6wunslXpYbw1RgbM='
WHERE
key_id = 'f6259b360230b04e97edc56400f5811f601f497d6ff25e57a746f482af71a7e2'
AND (
token = 'k7dbJFZp1yBgQ3UmV/rCHGxtNOn6wunslXpYbw1RgbM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)