UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bbTOm1ZxcbVKNYiZH5j3UjEJVpG5nUlEDzj/fBhl5Ro='
WHERE
key_id = '484961fbaa397822b5d72cbad5e7953b088a3a7e3c99192aec2c93625dcf7352'
AND (
token = 'bbTOm1ZxcbVKNYiZH5j3UjEJVpG5nUlEDzj/fBhl5Ro='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)