UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lMuoGp/obSjkjZmToZQOuJlTSgDTZjC8Bw5oIBXVX7o='
WHERE
key_id = 'e0a89da2f776c697607c5825228686633a418282ff8b0322c8d5289b406cabc6'
AND (
token = 'lMuoGp/obSjkjZmToZQOuJlTSgDTZjC8Bw5oIBXVX7o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)