UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JGnNohYxy8jx5ypGZVh/Y7qqgmpPjlpbOTmAbCyZhsc=' 
WHERE 
  key_id = '0cbd2971613d2960e31a3cffa6ec57dbfd8fe95665b17aa5abecc8878f5fb0d4' 
  AND (
    token = 'JGnNohYxy8jx5ypGZVh/Y7qqgmpPjlpbOTmAbCyZhsc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062