UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MY5LAGmstqX7pGRO1qFRRquZyqDH7JzSTLZ8AtB9vyY='
WHERE
key_id = '6a228da77c216fc0fe9004eaef4ae0da8c694032dc6905e0fefd0e8e2b18d4a1'
AND (
token = 'MY5LAGmstqX7pGRO1qFRRquZyqDH7JzSTLZ8AtB9vyY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)