UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uBKy0tyIzVywG/LiAareRANhKxjPz9VW13JCxWzyDOg=' 
WHERE 
  key_id = '74015ab4a813bcdba85d294f447a94546be60e7d7df7004efe2ea400d1a8277a' 
  AND (
    token = 'uBKy0tyIzVywG/LiAareRANhKxjPz9VW13JCxWzyDOg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043