UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p7PfuCNLJwYiFSoFKQYXA+l3/WGhDbsitz9V6PVmh20='
WHERE
key_id = '7ffb0574eaf397f48b782528f2f587f3d6fa488b88a46844bf9f688cbcff218d'
AND (
token = 'p7PfuCNLJwYiFSoFKQYXA+l3/WGhDbsitz9V6PVmh20='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)