UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zovPMzkZT+nJyvTK4idPvBkYZGZqP0+vqvhTjsmh2U4='
WHERE
key_id = 'ea03f12cc672b74cdbfeaf036573843e576798f68324031f9c6bd51ffccb9a3e'
AND (
token = 'zovPMzkZT+nJyvTK4idPvBkYZGZqP0+vqvhTjsmh2U4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)