UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EAq+QPk6poG6tquLzd/eP4UJWfgeN6btlCllOjQ9k6k=' 
WHERE 
  key_id = '7d0eaf5dd810107f83a9ea714da4b6cfc2122d29a91771a4ae9236ecaeb44710' 
  AND (
    token = 'EAq+QPk6poG6tquLzd/eP4UJWfgeN6btlCllOjQ9k6k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031