UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ra1BIaw4LSwR29OtqGcgn6fSBzKCAFs6kJEpL019IPk='
WHERE
key_id = '4d667ffc49b9809ca2154761977c22a006e92740f341fac795d377efd1fab614'
AND (
token = 'Ra1BIaw4LSwR29OtqGcgn6fSBzKCAFs6kJEpL019IPk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)