UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'giV27HlyB8a0crbM4BsD5o4FXRjxiyOpLxxVxV/wY4c=' 
WHERE 
  key_id = '11f30c7a5614c3ff8995f2e8c3e679413c46c7a8784e3305f61411d3c4a02af5' 
  AND (
    token = 'giV27HlyB8a0crbM4BsD5o4FXRjxiyOpLxxVxV/wY4c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018