UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GmLfV3I3dFYxyGlnMuVuJIjt/aNyg+T0VgQb7QKRt+8=' 
WHERE 
  key_id = '438b12a5f814933d23734fc0b76b1617e2a9cf114b2ed5f8ad3d67188db87a5d' 
  AND (
    token = 'GmLfV3I3dFYxyGlnMuVuJIjt/aNyg+T0VgQb7QKRt+8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036