UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jfFfkOPdlhZaG9axqjwBEHlTPPJoXb3yhhtqy3T9V2g='
WHERE
key_id = '623c48b2a1eeb330bce438978a2793fd241066694f08acebf76d5602c96d28c7'
AND (
token = 'jfFfkOPdlhZaG9axqjwBEHlTPPJoXb3yhhtqy3T9V2g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)