UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IGvtOaAumwvL20JvgU1kmbNU6uipsbPb58RAHyT4iWI='
WHERE
key_id = 'c09c0dd6dd82a4bd69f8935deb61b49d670124e0eedb2a089f0c257e76ed5806'
AND (
token = 'IGvtOaAumwvL20JvgU1kmbNU6uipsbPb58RAHyT4iWI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)