UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SqoqsDfMoHsAJ76ugcWqYj7UGSfm8JHvh7Ve86oaEdg=' 
WHERE 
  key_id = '838e38eeba426a08b4db68e28b65e249549ec49c79fcda887e11f65c44c1f9f9' 
  AND (
    token = 'SqoqsDfMoHsAJ76ugcWqYj7UGSfm8JHvh7Ve86oaEdg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033