UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SxW+ZdxVkj/Qovqoo2iluBnPBCPS+HjDIreNUF+h3EE='
WHERE
key_id = 'fab2ea51d84ca9386e71df56fcf64cf7100a7d55708a54f51efbf9a4a7ddf415'
AND (
token = 'SxW+ZdxVkj/Qovqoo2iluBnPBCPS+HjDIreNUF+h3EE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)