UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a1YD1mbrtquWGeu7aVV0oAKly08KxX35WRjGES6sits=' 
WHERE 
  key_id = '5d98225a2e3b4eb30570737be9fad801766a0de2d8015ee370b40db98f5c29f0' 
  AND (
    token = 'a1YD1mbrtquWGeu7aVV0oAKly08KxX35WRjGES6sits=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030