UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1X3dVXMmXgtfVtH/4cB0wDr3L/oiYx/Odwob35ozJGI='
WHERE
key_id = 'ae8e05fa10e3534218830f2a9c9139cd5e69ce29aafdf26f1b5e38e19dfec82a'
AND (
token = '1X3dVXMmXgtfVtH/4cB0wDr3L/oiYx/Odwob35ozJGI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)