UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5LacSXVTsSQZEHiexbZS5AZIn+HY83j9X+rDlShpGSk=' 
WHERE 
  key_id = 'cad225846996b3d030ce02dd814fc8902fef80f5f2787c9884ef3c2387c106cd' 
  AND (
    token = '5LacSXVTsSQZEHiexbZS5AZIn+HY83j9X+rDlShpGSk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029