UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kx9AZn4dWdHUmDaM2TlaBG/SBJMfv6qhlD/C7WqnbyQ=' 
WHERE 
  key_id = '3a3ac5c3b874bb58fe9a2e70a7d3902c11328eb9cb12e3ff51364d2efa8836c5' 
  AND (
    token = 'kx9AZn4dWdHUmDaM2TlaBG/SBJMfv6qhlD/C7WqnbyQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00080