UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8JkMLt4P2h2X4eBRkchWw4UAG3WpmLs6pLsONkNecmo='
WHERE
key_id = '47519426de0f7fa351b2587382e5ffb62b1d2d974b9c1fcc87e215efc3d45f39'
AND (
token = '8JkMLt4P2h2X4eBRkchWw4UAG3WpmLs6pLsONkNecmo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)